import request from "@/utils/request";

export function getDevices(userId: any) {
  return request({
    url: "/device",
    method: "get",
    params: {
      userId,
    },
  });
}

export function addDevice(data: any) {
  return request({
    url: "/device",
    method: "post",
    data,
  });
}

export function editDevice(id: any, data: any) {
  return request({
    url: `/device/${id}`,
    method: "put",
    data,
  });
}

export function deleteDevice(code: any) {
  return request({
    url: `/device/${code}`,
    method: "delete",
  });
}
